home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / 386bsd-faq / part7 < prev    next >
Encoding:
Text File  |  1995-07-25  |  29.9 KB  |  702 lines

  1. Subject: [comp.os.386bsd] BNR/2 derived BSD for PCs FAQ (Part 7 of 10)
  2. Newsgroups: comp.os.386bsd.announce,comp.answers,news.answers
  3. From: burgess@cynjut.infonet.net (Dave Burgess)
  4. Date: 13 Nov 1994 10:41:53 -0600
  5.  
  6. Posted-By: auto-faq 3.1.1.2
  7. Archive-name: 386bsd-faq/part7
  8.  
  9. Section 6.    (Interaction with MS-DOS)
  10.  
  11. 6.0    Working with DOS and BNR/2 related software.
  12.  
  13.     This section is designed to cover some of the more common 
  14.     problems that DOS will have when interacting with BNR/2.
  15.     There are other sections of the FAQ that deal with 
  16.     indirectly with this .  Try looking in sections 0, 1, and 2
  17.     to see if something in there (particularly when talking 
  18.     about DOS and *BSD coexisting on a single drive).
  19.  
  20.     
  21. 6.1    Formatting a floppy
  22.  
  23.     There is a rumor that floppy formatting either is possible or was
  24.     possible at one time.  If you see any software or FTP sites with 
  25.     anything about this, please contact burgess@cynjut.infonet.net
  26.     and I will make sure it gets updated in here.
  27.  
  28.     There was a set of patches that were developed to allow floppy
  29.     formatting.  They are not currently included in any of the *BSD
  30.     systems.
  31.  
  32.     I have actually applied the patches for floppy formatting here
  33.     on an older version of NetBSD, and they seem to work just fine.
  34.     The fdformat program could use some work, but seems to work OK.  
  35.     According to the author, similar patches are available for
  36.     FreeBSD and the original 386BSD.  The package that I used here
  37.     was posted in comp.os.386bsd.* somewhere.  I think that it is 
  38.     available by anonymous FTP from cynjut.infonet.net.  If not,
  39.     E-Mail me at burgess@cynjut.infonet.net and I will mail you a
  40.     tar file with the stuff that I have available.
  41.     
  42.  
  43. 6.2    Sharing the Disk with MS-DOS
  44.  
  45.     There are a myriad of questions about how to share a disk between
  46.     386bsd and MS-DOS.  They all boils down to one of the <n> following
  47.     questions:
  48.  
  49.     1)  How can I partition my drive for both MS-DOS and 386bsd?
  50.     2)  I can install using the whole disk, but I can't install when 
  51.     I try to share the drive between 386bsd and MS-DOS.  Why?
  52.     3)  I can use either MS-DOS or 386BSD on my hard drive,
  53.     but shutdown -todos doesn't seem to work.
  54.  
  55.  
  56. 6.2.1    How can I partition my drive to support both MS-DOS and *bsd?
  57.  
  58.     NOTE:  Before attempting to install *bsd on a computer with an
  59.     active DOS partition, ALWAYS back up your hard drive.  No one on 
  60.     the net, no matter how talented, can help you recover a hosed 
  61.     MS-DOS file system.  If you lose all of your data, it is YOUR
  62.     fault.
  63.  
  64.     During the install phase, you need to have un-allocated space left
  65.     on your disk drive.  This allows the install program to correctly
  66.     install the *bsd partition in the partition table and DOS to
  67.     peacefully co-exist with *bsd.
  68.  
  69.     If you do not have any space available on your hard drive, you will
  70.     not be able to install both.  Re-fdisk your hard drive and make
  71.     sure you have left un-allocated space in the partition table.  
  72.     This WILL wipe out your DOS partition - Permanently.
  73.  
  74.     Even though the partition table procedure above may have worked, 
  75.     there are still no guarantees that your system will boot after
  76.     the install.  This problem most often manifests itself as one of
  77.     the endless reboot problems.  You would normally be able to boot
  78.     DOS from the hard disk, but not *bsd (once that partition is
  79.     marked as active).
  80.  
  81.     Once the partition table has been correctly defined with both
  82.     DOS and *bsd, there can still be problem.  One of the most
  83.     common is that the disk drive works in some sort of translation
  84.     mode.  This is particularly common with drives that physically have
  85.     more than 1024 cylinders.  DOS cannot access a drive with more than
  86.     1024 cylinders.  Translation mode will have to be turned off, usually
  87.     by redefining your hard drive in SETUP as one of the user definable
  88.     types.  This change will normally trash your hard drive, or at least
  89.     render your DOS partition unreadable.
  90.  
  91.     The solution to this problem is to install *bsd at the end of the
  92.     hard drive.  While DOS cannot use cylinders above 1024, *bsd has
  93.     no such limitations, once it has booted.  During the boot-up phase,
  94.     some of the newer boot blocks will refer to the BIOS for some
  95.     services.  Specifically, the disk is checked for a bad sector map
  96.     on the last track.  Since the BIOS cannot deal with cylinders
  97.     higher than 1024, your bad sector map will be incorrectly
  98.     identified as 1023 if the number of cylinders is larger than that.
  99.     This problem is being worked on, and I hope to change this section
  100.     with better news later.
  101.  
  102.     NOTE:  The only people that this problem will effect are those 
  103.     MFM and ESDI users that have drives with more than 1023 tracks.  
  104.     While drives of this type are not the overwhelming majority, 
  105.     neither are they an anomoly.  People are working on it.
  106.  
  107.     As an example, if your hard disk physically has 8 heads, 16 sectors 
  108.     per track, and 2000 cylinders (128M); you MUST use some sort of disk
  109.     translation in order to use the entire drive.  An obvious geometry
  110.     for this drive (for DOS) would be 16 heads, 16 sectors, and 1000
  111.     cylinders.  Unfortunately, *bsd operates using the disk drives
  112.     native geometry as reported during the probe phase of boot up.  This
  113.     will probably be 8/16/2000, and will NOT agree with your translated
  114.     disk geometry.  This causes an endless reboot cycle.  If you change
  115.     the geometry so that the drive agrees with the disklabel, your DOS
  116.     partition is toast.
  117.  
  118.     The best way to operate in this case would be to (for example)
  119.     split the disk in half.  That leaves 64M for DOS, using a 
  120.     geometry of 8 heads, 16 sectors per track, and the first 1000 
  121.     cylinders for DOS.  The second 1000 cylinders could then safely
  122.     be used for *bsd.  The DOS partition table may even be capable of
  123.     showing this partition as it actually exists.
  124.  
  125.         ACCESSING MS-DOS PARTITIONS FROM NetBSD-i386
  126.  
  127.     First off, it's important to understand BSD disklabels.  The 
  128.     disklabel is a description of the Unix parition layout and other 
  129.     disk parameters stored on-disk, usually somewhere in the first 
  130.     couple of sectors.  There is a maximum of 8 partitions, labelled 
  131.     "a" thru "h".  Typically partition "a" is assigned to the root 
  132.     partition, partition "b" is configured as a swap area, and 
  133.     partition "c" is defined as the whole disk.  You can change these, 
  134.     but it's a good idea to stick with this scheme, as many programs 
  135.     assume that's the way things are going to be.
  136.  
  137.     If you're whole disk is dedicated to Unix, then that's all you 
  138.     need to know.  But if you're sharing your disk with DOS, then 
  139.     there are a few magical things happening.
  140.  
  141.     DOS has it's own partitioning scheme.  The way NetBSD co-exists 
  142.     with this is to fit all of the Unix partitions into one DOS 
  143.     partition.  So partitions a-h all fit inside one DOS partition, 
  144.     which has a partition type of 165 (each MS-DOS partition has a 
  145.     "partition type" associated with it.  The BSD partition type is 
  146.     165).  In this setup, partition "c" refers to the entire BSD 
  147.     partition.  But in this scheme, partition "d" refers to the ENTIRE 
  148.     disk, MS-DOS partitions and all.
  149.  
  150.     So, if you want to access your MS-DOS partition from NetBSD, first 
  151.     you'll have to create a partition that points to the MS-DOS 
  152.     partition.  You'll want to run the command:
  153.  
  154.     disklabel -e -r /dev/r??0d    (fill in with your disk type).
  155.  
  156.     You'll get popped into an editor with all the disklabel stuff in 
  157.     it.  Go down to the bottom.  You should see something like:
  158.  
  159.     6 partitions:
  160.     #        size   offset    fstype   [fsize bsize   cpg]
  161.       a:    30720   409600    4.2BSD     1024  8192    16   # (Cyl...
  162.       b:   129024   440320      swap                        # (Cyl...
  163.       c:  1617920   409600    unused        0     0         # (Cyl...
  164.       d:  2029568        0    unused        0     0         # (Cyl...
  165.       e:    61440   569344    4.2BSD     1024  8192    16   # (Cyl...
  166.       f:  1396736   630784    4.2BSD     1024  8192    16   # (Cyl...
  167.     
  168.     (or whatever it appropriate for your disk).  Note that partition 
  169.     "a" starts on cylinder 200.  That's where my BSD partition starts 
  170.     on my disk.  Also note that partition "c" starts at 200 as well 
  171.     and goes to the end of the disk.  You'll also note that partition 
  172.     "d" goes from sector 0 all the way to the end of the disk.
  173.     
  174.     Add a new line that looks something like:
  175.     
  176.       g:   409568       32    MS-DOS                        # (Cyl.    0*- 199*)
  177.     
  178.     (The comment on the end isn't necessary.  Only the partition 
  179.     letter, size, offset, and parition type are needed.  You can 
  180.     put unused in instead of MS-DOS if you want).
  181.     
  182.     *NOTE* Be sure to change the line that says "6 partitions" to the 
  183.     new number of paritions that you have!!!  Otherwise you'll get an 
  184.     obscure error.  In my case I'd change that line to be "7 partitions".  
  185.     If you aren't sure what your MS-DOS partition size and offsets are, 
  186.     you can use the NetBSD fdisk to find them out.  Don't forget that 
  187.     there's a maximum of 8 partitions.  
  188.  
  189.     Once you do that and you have MSDOSFS configured into your kernel, 
  190.     you can just do something like "mount -t msdos /dev/sd0g /msdos".  
  191.     Or you can put a line like this in your fstab:
  192.     
  193.     /dev/sd0g /msdos msdos rw 0 0
  194.     
  195.     If you want to access a DOS-only HD from NetBSD, here are some 
  196.     instructions posted by Charles Hannum a while back.  I haven't 
  197.     tried them myself, but they seem like they would work.
  198.     
  199.     Assuming you don't have something (like OS-BS) which uses the extra
  200.     sectors in the boot track, you can do the following:
  201.  
  202.     1) Use the NetBSD `fdisk' or DOS `pfdisk' to create a NetBSD 
  203.     partition in the MBR which spans the entire disk.
  204.  
  205.     2) Save a copy of the MBR:
  206.  
  207.         dd if=/dev/rsd0d of=my-mbr bs=1b count=1
  208.  
  209.     3) Use `disklabel' to create a NetBSD label with the DOS partition 
  210.     and whatnot.  Answer `y' when it asks you if you want to `overwrite 
  211.     [a] disk with [a] DOS partition table'.
  212.  
  213.     4) Put back the saved copy of the MBR:
  214.  
  215.         dd if=my-mbr of=/dev/rsd0d bs=1b count=1
  216.  
  217.     This works for me.  Your milage may vary.
  218.  
  219.     Luke Mewburn <zak@rmit.edu.au> has provided the following tutorial on 
  220.     using the pfdisk program and making your *bsd/NetBSD partitions
  221.     peacefully coexist with DOS.  While this is kind of a 'cookbook' 
  222.     approach, please keep in mind that this is probably easily 
  223.     transferrable to all BNR derived Unices.
  224.  
  225.  
  226.             Getting NetBSD 0.8 to coexist with DOS.
  227.  
  228.             Written 930510 by Luke Mewburn <zak@rmit.edu.au>
  229.  
  230.  
  231.     NetBSD can be made to happily co-exist with DOS if its install
  232.     program knows how to modify the partition table. This assumes
  233.     that you have access to a program which enables you to edit the
  234.     partition table of your hard drive (such as Norton Utilities, or
  235.     pfdisk).
  236.  
  237.     When you partition your hard drive, you will probably have a large
  238.     partition in which you wish to place NetBSD. This has to have the
  239.     partition ID of 165d (or 0xA5). To change this, you can use the
  240.     'Partition Edit' section of Norton's, or you can use pfdisk.
  241.     This document will go into more detail on how to use pfdisk, as it's
  242.     freely available.
  243.  
  244.     I'll use my personal drive specifications in the following example.
  245.     It is a 1001 cylinder, 15 trk/cyl, 17 sec/trk, 125MB drive. I
  246.     low-level formatted it, and used fdisk on a MS-DOS 5.0 boot disk to
  247.     create a primary partition '1' of 32MB, and an extended partition '2'
  248.     of 93MB.  I formatted the drive with format c: /s to give myself a
  249.     bootstrap for DOS (much faster than floppies :), but this isn't that
  250.     necessary. Now, the next stage...
  251.  
  252.     Running pfdisk 0 (to access my first (and only :) HD) came up with
  253.     something like:
  254.     
  255.     For help, enter: '?'
  256.     pfdisk>
  257.  
  258.     At the prompt, enter 'l' to list partitions, giving (in my case),
  259.     something like:
  260.  
  261.     # Partition table on device: 0
  262.     geometry 1000 15 17 (cyls heads sectors)
  263.     #  ID  First(cyl)  Last(cyl)  Name  # start, length (sectors)
  264.     1   4      0        256       DOS16 # 17, 65518
  265.     2   0    257        999       unkno # 65535, 189465
  266.     3   0      0          0       empty # 0, 0
  267.     4   0      0          0       empty # 0, 0
  268.     active: 0 (none)
  269.  
  270.     (Note that there is 1 cylinder less - the last one is, I think,
  271.     for the IDE controller to use when auto-mapping dud sectors out.)
  272.  
  273.     Now, we want to change the type of #2 (the prospective NetBSD
  274.     partition) to 165. You can obtain a list of known IDs by selecting
  275.     'I'. Depending on the version of pfdisk you have, 165 may or may not
  276.     be known. This doesn't matter too much either way. To get the NetBSD
  277.     install program to use the 2nd partition, I would enter:
  278.  
  279.     pfdisk> 2 165 257 999
  280.  
  281.     Another 'l' to list partitions would show that the entry for
  282.     partition 2 will either look like one of the following (depending
  283.     on whether pfdisk knows about the 386bsd partition type or not):
  284.  
  285.     2 165    257        999       unkno # 65535, 189465
  286.     or
  287.     2 165    257        999       386BS # 65535, 189465
  288.  
  289.  
  290.     You could set the active partition with 'a 2' if you want NetBSD
  291.     to always boot, but I personally recommend that you obtain a copy
  292.     of OS-BS 1.35 or BOOTEASY to save you the hassle of running fdisk
  293.     or pfdisk every time you wish to swap system types.
  294.  
  295.     To complete everything off, do 'w' to write out the info (once
  296.     you're sure it's correct! :), and 'q' to quit the program.
  297.  
  298.  
  299.     Well, I hope that is useful to someone. Comments can be directed
  300.     to the author (Email: <zak@rmit.edu.au>).
  301.  
  302.  
  303. 6.2.2    I can install using the whole disk, but I can't install when 
  304.     I try to share the drive between 386bsd and MS-DOS.  Why?
  305.  
  306.     This is an extension of the question above.  The most common reason
  307.     for this is, once again, disk translation problems.  If the 
  308.     disklabel does not agree with the disk geometry, the install will
  309.     fail.  Other incarnations of this problem are that you can install
  310.     DOS, then 386bsd, and DOS will be hosed, or vice versa.
  311.  
  312.     There are more than a couple of people who will blithely suggest that
  313.     this is a good thing, and you should install 386bsd exclusively,
  314.     job not withstanding.
  315.  
  316.  
  317. 6.2.3    I can use either MS-DOS or 386BSD on my hard drive,
  318.     but shutdown -todos doesn't seem to work.
  319.  
  320.     There is a known bug in shutdown that prevents the -todos option 
  321.     from working as advertised on all but the smallest DOS partitions.
  322.     Many people have reported some success while using a very small
  323.     (less than 32M) DOS partition as the first partition.
  324.  
  325.     There is a utility available for 386bsd which operates very much
  326.     like the MS-DOS fdisk partitioning program.  You can use this program
  327.     to mark the DOS partition active from 386bsd.  A similar procedure
  328.     is used (fdisk in DOS) to mark the 386bsd partition as the active
  329.     boot partition.  Boot managers are also an excellent investment for
  330.     those individuals that need to boot both DOS and 386BSD.
  331.  
  332.  
  333. 6.2.4    Is there any hope of ever running MS-DOS applications under any of
  334.     the free BSD systems?
  335.  
  336.     There is currently a project in development to port the Windows 
  337.     program exvironment to Linux and the *BSD systems.  Here is an
  338.     excerpt from the original message announcing the project:
  339.  
  340.     As many of you already know, we are in the process of creating a
  341.     Windows emulator.  This emulator is similar to Sun's Wabi product, 
  342.     but is being developed completely independent of them.  Many of 
  343.     you are anxious to hear the latest status of the project.  I have 
  344.     created a mailing list for those of you.  To join the list, simply 
  345.     send mail to:
  346.  
  347.     wine-project-info@amscons.com
  348.  
  349.     If your mailing address is not easy to deduce from the mail 
  350.     headers, then place the following line in the body of the message 
  351.     that you send.
  352.  
  353.     Reply-To: youraddress@yourmachine
  354.  
  355.     where youraddress@yourmachine should be replaced by your actual 
  356.     mailing address.
  357.  
  358.  
  359. 6.3    Accessing the MS-DOS filesystem 
  360.  
  361.     One of the most common MS-DOS related questions (with the possible
  362.     exception of 6.2 above) is how to access the DOS disk partitions
  363.     from 386bsd.  One way is to modify mtools so that it recognizes your
  364.     DOS partition.  This solution is provided by Jim Paradis 
  365.     (paradis@sousa.ltn.dec.com):
  366.  
  367.     --------------------------------------------------------------------
  368.     To build a /usr/othersrc/public/mtools.2.0.5/devices.c file that 
  369.     lets you access the DOS partition, you need to know the byte offset 
  370.     of the DOS partition from the start of the hard disk.  You would then 
  371.     add an entry to the devices[] array as follows:
  372.  
  373.     {'C', "/dev/wd0d", <byte-offset>L, 16, 0, (int (*) ()) 0, 0, 0, 0},
  374.  
  375.     So, f'rinstance, if your DOS partition starts at the beginning of
  376.     the disk, you'd have:
  377.  
  378.     {'C', "/dev/wd0d", 0L, 16, 0, (int (*) ()) 0, 0, 0, 0},
  379.  
  380.     On the other hand, if your DOS partition starts 32MB into the disk,
  381.     you'd say something like:
  382.  
  383.     {'C', "/dev/wd0d", (32768L * 1024L), 16, 0, (int (*) ()) 0, 0, 0, 0},
  384.  
  385.     --------------------------------------------------------------------
  386.     Of course, this is both the hard and VERY non-portable way of
  387.     solving this problem.  An easier way would be to add PCFS or 
  388.     MSDOSFS to your *BSD system.  Both the PC File system and PC 
  389.     Network File System (PC-NFS) code has been ported to 386bsd/
  390.     NetBSD/FreeBSD.  These are available from several sources, 
  391.     including the patchkit and in the -current trees. 
  392.  
  393.     The instructions for using PCFS with 386BSD are provided by Scott 
  394.     Miles <gt1679c@prism.gatech.EDU>. 
  395.  
  396.         What would probably be easier would be to add a partition to 
  397.         the disklabel for your DOS drive and then just mount it with 
  398.         PCFS.  I don't know if it's in the FAQ now, I haven't read it 
  399.         for a while, but this is what I did:
  400.  
  401.         1) run 'fdisk' and write down the DOS partition info for 
  402.         the start and size that it gives you.
  403.  
  404.         2) disklabel -e -r /dev/<raw device>
  405.               - Add 1 to the '# partitions:', and then add another line 
  406.               for the DOS partition .  Mine went in after e: as 
  407.  
  408.        f:   130977     63   unused      0     0     # (Cyl.    0*- 129*)
  409.  
  410.     (Ed.Note:  The unused should be something else, although I really
  411.         couldn't tell you what. MSDOS is a recognized partition 
  412.         type name; maybe that should be used.  Also, make sure that
  413.         your c: and d: partitions do not overlap this area.  h: might 
  414.         be a better partition letter to use; that way the MSDOS 
  415.         partition is graphically separate from the rest of the BSD
  416.         partitions.  DO NOT USE a:, b:, c:, or d: for your DOS 
  417.         partition.  These are RESERVED for your BSD system and any 
  418.         attempt to use these for anything but what BSD uses them for 
  419.         will result in a completely hosed, totally dead, absolutely 
  420.         screwed up file system.  You have been warned! )
  421.  
  422.         3) Add a line to /etc/fstab if you want it mounted 
  423.         automatically.
  424.              Mine is:
  425.              /dev/wd0f   /dos      pcfs  rw   1       2
  426.  
  427.            Otherwise, just mount -t pcfs /dev/<part> /<dir>
  428.  
  429.     Mount has other options that may improve performance or increase
  430.     security for your system.  See 'man mount' for more information 
  431.     about mounting your system read-only and other advanced features.
  432.  
  433.     In addition to this, Jordan Hubbard has provided us with the
  434.     following description for mounting the DOS partition specifically
  435.     from FreeBSD:
  436.  
  437.         How to mount your DOS partition from FreeBSD
  438.  
  439.     1. First, be root.  The following won't work as an ordinary user.
  440.  
  441.     2. Second, use 'fdisk' to see where your DOS partition starts.  
  442.     It will be labeled as type DOS.  On my system, 'fdisk /dev/sd0d' 
  443.     produces the following:
  444.  
  445.         ... (extraneous output, not of interest) ...
  446.     The data for partition 0 is:
  447.     sysid 6,(Primary 'big' DOS (> 32MB))
  448.         start 32, size 306400 (149 Meg), flag 0
  449.             beg: cyl 0/ sector 1/ head 1;
  450.             end: cyl 149/ sector 32/ head 39
  451.  
  452.         This shows me that my DOS partition starts at sector 32, and 
  453.     is 306400 (512 byte) sectors long.
  454.  
  455.     NOTE:  If you're trying to mount a DOS `EXTENDED' partition, then 
  456.     you need to add `32' to this start address you got from fdisk in 
  457.     subsequent calculations, I.E. in the above example (assuming it 
  458.     was an EXTENDED partition rather than the Primary), you'd use 
  459.     `start 64, size 306400'.
  460.  
  461.     [Ed.Note.  This example assumes a SCSI disk.  For disks with a 
  462.     number of sectors per track which is different than 32, you will
  463.     probably see the 32s above replaced with your number of sectors
  464.     per track. ]
  465.  
  466.     3. Next, using this information, you craft a new disk entry in your
  467.        /etc/disktab file that assigns one of your unused "UNIX" 
  468.        partitions to this DOS region.  Again, using my system as a 
  469.        default, you see I've created:
  470.  
  471.     disk0|DEC 5501:\
  472.         :ty=winchester:dt=SCSI:se#512:nt#8:ns#256:nc#1001:rm#3600:\
  473.         :pa#956416:oa#307200:ba#8192:fa#1024:ta=4.2BSD:\
  474.         :pb#131072:ob#1263616:tb=swap:\
  475.         :pc#1087488:oc#307200:tc=UNUSED:\
  476.         :pe#306400:oe#32:te=MSDOS:
  477.  
  478.        As you can see, partition 'e' now points to the DOS partition as
  479.        pointed out by fdisk.
  480.  
  481.        [Ed.Note again.  Remember what I said about the 32 above...]
  482.        
  483.  
  484.     4. Now we have to actually stick the label on the disk, which is done
  485.        with disklabel.  Using my example, this would be:
  486.  
  487.         disklabel -r -w sd0 disk0 SCSI /usr/mdec/sdboot /usr/mdec/bootsd
  488.  
  489.     5. Reboot your system to see the new disk label.
  490.  
  491.     6. Mount the DOS partition.  I do:
  492.  
  493.         mount -t pcfs /dev/sd0e /dos_c
  494.  
  495.        Where /dos_c is just a convenient directory to mount it.
  496.  
  497.     7. You're set!
  498.  
  499.     With the exception that the '-t' option is msdos in NetBSD, these 
  500.     instructions seem to work with the same facility for NetBSD.  I
  501.     also received a note a couple of weeks ago (that I promptly deleted
  502.     because I new that I would remember what it said) that DOS extended
  503.     partitions are readable if you skip the first 'n' blocks in your 
  504.     computations (where 'n' is your number of sectors per track).  This 
  505.     way, you skip over the 'new' part of the DOS file system.  That means 
  506.     that insted of the oe:32 above, you would need an oe:48 instead.  
  507.  
  508.     Also remember that the compressed file system in DOS 6 will probably
  509.     be completely greek to your NetBSD/FreeBSD system.  I seriuosly 
  510.     doubt that you will be able to read the compressed DOS file system
  511.     anytime in the forseeable future.
  512.      
  513.  
  514. 6.4    NFS/PC-NFS support
  515.  
  516.     The problems normally associated with PC-NFS are also associated 
  517.     with NFS in general.  
  518.  
  519.  
  520. 6.4.1    Can I use 8K packets for NFS?  When I try, I have all kinds of 
  521.     problems.
  522.  
  523.     In addition to the NE2000 card, this problem can also manifest 
  524.     itself on other ISA networks cards that have a limited amount of
  525.     memory.  Ken Raeburn (raeburn@cambridge.cygnus.com) has identified 
  526.     a common problem with the NE2000 card and provided us with a work
  527.     around:
  528.  
  529.     --------------------------------------------------------------------
  530.     I reported previously that I was seeing problems reading files over
  531.     NFS using the ne2000 driver; timeouts would eventually be reported, no
  532.     data would be read.  Listing files and directories (small ones
  533.     anyway) were not a problem.
  534.  
  535.     After playing with etherfind and kernel printfs, I've come to this
  536.     conclusion: Fragmented 8K UDP packets from the NFS server are not
  537.     reaching the UDP layer in 386bsd.  The Sun is sending them (according
  538.     to another Sun spying on the network), but the UDP input routine is
  539.     never called.  I don't know if the bug here is on the 386bsd or Sun
  540.     side, and won't have time to look into it in the next couple of days.
  541.  
  542.     In the meantime, mounting NFS file systems with "rsize=1024" does get
  543.     rid of this problem.
  544.  
  545.     Ken
  546.     --------------------------------------------------------------------
  547.  
  548.     As a matter of policy, specifying "rsize=1024,wsize=1024" works very
  549.     well also, and makes the transfers seem to run faster.  This is
  550.     probably because there are fewer collisions.  The disadvantage of 
  551.     this method comes from the kernel 'sync'ing after all NFS writes.  
  552.     This can slow NFS accesses considerably.  As with most 
  553.     generalizations, this one too can do nearly as much harm as good.  
  554.     Charles Hannum reports that he has no trouble using the default 8K 
  555.     packet size.  If you have trouble, reduce your default packet size
  556.     until the problem goes away.
  557.  
  558.     WIth the newer drivers (especially the ed driver) most of these 
  559.     problems are solved automagically.  If you are still using the
  560.     original 386bsd 0.1 release, you REALLY need to upgrade.
  561.     
  562.  
  563. 6.4.2    How do I get around the NFS "Permission denied" error?
  564.  
  565.     The problem is not the configuration of the server (unless there is
  566.     no real requirement to run it in "secure" mode, and you happen to
  567.     be running it that way anyway).  The problem is the fact that,
  568.     even though mount request are sent on a privileged port, NFS
  569.     connections are not.  This is part of secure NFS, and is not
  570.     supported in 386BSD.
  571.     
  572.  
  573. 6.4.3    What does the message "BAD MNT RPC: RPC Authentication error; 
  574.     why = Invalid client credential" mean when I try to mount something
  575.     from another machine?
  576.  
  577.     Hellmuth Michaelis (hm@hcshh.hcs.de) offers the solution to this
  578.     relatively common problem:
  579.  
  580.     You have to make sure that the user "root" is not present in more
  581.     than 8 entries in the "/etc/group" - file on the 386BSD machine.
  582.     Simply remove some entries and the NFS mounts will succeed.
  583.  
  584.     The problem is also explained in the Clarkson Driver documentation.
  585.     On 386bsd, the maximum number of groups that can be associated with
  586.     a particular user is specified in the source (in a #DEFINE).  In 
  587.     386bsd, this number is set to 8.  So, you actually have two routes
  588.     you can take to correct this problem.  The first is outlined by
  589.     Hellmuth, above, and the second is to edit and recompile the NSF
  590.     software to allow more groups.
  591.  
  592.  
  593. 6.4.4    What does the message "Bad MNT RPC: RPC: Authentication error; 
  594.     why = Client credential too weak" mean when I try to mount something
  595.     from another machine?
  596.  
  597.     This problem is a standard NFS problem; it simply means that your 
  598.     user number is not one of the ones that can mount this NFS.  
  599.     Normally, you will get this message when you are trying to mount 
  600.     a filesystem from a machine that allows 'root' to mount an NFS,
  601.     but limits other users.
  602.  
  603.  
  604. 6.4.5    I get a lot of 'ring buffer overflow' messages using NFS and the
  605.     ed0 driver.  Is there a problem?
  606.  
  607.     David Greenman (davidg@implode.rain.com), the original author of 
  608.     the ed0 driver, provides us with some insight into the inner 
  609.     workings of the ed0 driver.
  610.  
  611.        It always surpises me that people don't just ask the original 
  612.     author these questions. :-) Anyway, the reason these are happening 
  613.     is that the access to the 8bit boards shared memory simply isn't 
  614.     fast enough to deal with full wire speeds...but the driver tries 
  615.     hard...so even though packets get dropped, your performance only 
  616.     drops to about what the ethernet board is capable of (should be 
  617.     in the 400-600k range with an 8bit card). NFS is especially bad 
  618.     because the UDP window is quite large (40k last time I looked), 
  619.     so the overflow condition can happen easily. I've explained this
  620.     for the most part in the release notes for the driver, but these 
  621.     didn't make it into either the FreeBSD or NetBSD releases (we 
  622.     couldn't find an appropriate place to put them).
  623.  
  624.     >From the release notes:
  625.  
  626.     receive
  627.     -------
  628.        The 8390 implements a shared memory ring-buffer to store 
  629.     incoming packets.  The 8bit boards (3c503, and 8003) usually have 
  630.     only 8k bytes of shared memory.  This is only enough room for about 
  631.     4 full size (1500 byte) packets. This can sometimes be a problem, 
  632.     especially on the original WD8003E and 3c503.  This is because these 
  633.     boards' shared memory access speed is also quite slow compared to 
  634.     newer boards - typically only about 1MB/second. The additional 
  635.     overhead of this slow memory access, and the fact that there is 
  636.     only room for 4 full-sized packets means that the ring-buffer 
  637.     will occassionally overflow.  When this happens, the board must 
  638.     be reset to avoid a lockup problem in early revision 8390's.  
  639.     Resetting the board will cause all of the data in the ring-buffer 
  640.     to be lost - requiring it to be re-transmitted/received...slowing 
  641.     things even further.  Because of these problems, maximum throughput 
  642.     on boards of this type is only about 400-600k per second. The 16bit 
  643.     boards (8013 series), however, have 16k of memory as well as much 
  644.     faster memory access speed. Typical memory access speed on these 
  645.     boards is about 4MB/second. These boards generally have no problems 
  646.     keeping up with full ethernet speed. The only problem I've seen 
  647.     with these boards is related to the (slow) performance of 386BSD's 
  648.     malloc code when additional mbufs must be added to the pool. This 
  649.     can sometimes increase the total time to remove a packet enough 
  650.     for a ring-buffer overflow to occur.  
  651.  
  652.  
  653. 6.4.6    Is there any PC software that will allow me to use my enormous PC
  654.     with all of the unsupported hardware as a PC-NFS server?
  655.  
  656.     Yes.  It is called SOSS, and is available from MANY FTP sources.
  657.     You will need the aforementioned Clarkson Packet Drivers for it
  658.     to work, but that should cause too many problems for most people.
  659.  
  660.  
  661. 6.5    How can I use mtools with the 'new' floppy naming convention?
  662.  
  663.     With the adoption of BSD 4.4, there is a new way of accessing
  664.     the floppy disk drive types.  The method uses the minor device
  665.     number to specify different media sizes and densities.  These
  666.     densities are established by a table from the file 
  667.     /usr/src/sys/arch/i386/isa/fd.c (in NetBSD, your mileage may
  668.     vary).  The table in FreeBSD's fd.c is likely to be slightly
  669.     different.
  670.  
  671.     The order of the entries defines the order of the minor
  672.     numbers, so the table below has the following characteristics:
  673.  
  674.          /dev/fd0a    1    /* 1.44MB diskette */ 
  675.         /dev/fd0b    2    /* 1.2 MB AT-diskettes */ 
  676.         /dev/fd0c    3    /* 360kB in 1.2MB drive */ 
  677.         /dev/fd0d    4    /* 360kB PC diskettes */ 
  678.         /dev/fd0e    5    /* 3.5" 720kB diskette */ 
  679.         /dev/fd0f    6    /* 720kB in 1.2MB drive */ 
  680.         /dev/fd0g    7    /* 360kB in 720kB drive */
  681.  
  682.     struct fd_type fd_types[] = {
  683.             { 18,2,0xff,0xcf,0x1b,0x6c,80,2880,1,FDC_500KBPS,2,"1.44MB"  },
  684.             { 15,2,0xff,0xdf,0x1b,0x54,80,2400,1,FDC_500KBPS,2,"1.2MB"   },
  685.             {  9,2,0xff,0xdf,0x23,0x50,40, 720,2,FDC_300KBPS,2,"360KB/AT"},
  686.             {  9,2,0xff,0xdf,0x2a,0x50,40, 720,1,FDC_250KBPS,2,"360KB/PC"},
  687.             {  9,2,0xff,0xdf,0x2a,0x50,80,1440,1,FDC_250KBPS,2,"720KB"   },
  688.             {  9,2,0xff,0xdf,0x23,0x50,80,1440,1,FDC_300KBPS,2,"720KB/x" },
  689.             {  9,2,0xff,0xdf,0x2a,0x50,40, 720,2,FDC_250KBPS,2,"360KB/x" },
  690.     };
  691.  
  692.     In order to add a new device (such as a 2.44 Meg floppy) new
  693.     tables entries are theoretically all that would be needed.  As
  694.     new entries are created, the minor device numbers would
  695.     increase and the associated device names would be added.
  696. -- 
  697. TSgt Dave Burgess           | Dave Burgess
  698. NCOIC, USSTRATCOM/J6844     | *BSD FAQ Maintainer
  699. Offutt AFB, NE              | Burgess@cynjut.infonet.net or ...@s069.infonet...
  700.                                
  701.  
  702.